package com.maven.logging;

import org.apache.log4j.Logger;

import java.text.MessageFormat;

/**
 * Created with IntelliJ IDEA.
 * User: EAD-MASTER
 * Date: 5/15/13
 * Time: 6:56 PM
 * To change this template use File | Settings | File Templates.
 */
public abstract class AbstractLoggingBenchmark {


	protected AbstractLoggingBenchmark() {
	}

	protected void log4jNormalString(Logger log4j) {
		log4j.debug(("runLog4jTest(): may help prevent outbreaks of cold sores and genital herpes=" +
				LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_4).trim());
	}

	protected void log4jWithMessageFormat(Logger log4j) {
		log4j.debug(MessageFormat.format("runLog4jTest():Can reduce high blood glucose level= {0}",
				LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_3).trim());
	}

	protected void log4jWithStringBuilder(Logger log4j) {
		log4j.debug(new StringBuilder().append("runLog4jTest(): High found in Eggs & Tofu=").
				append(LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_2).toString().trim());
	}

	protected void log4jWithStringFormat(Logger log4j) {
		log4j.debug(String.format("runLog4jTest(): Can be found in Meat, Fish and Diary=%s",
				LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_1).trim());
	}


	protected void logbackjNormalString(org.slf4j.Logger logback) {
		logback.debug(("runLog4jTest(): may ease depression, stop inflammation, alleviate liver disease and relieve muscle pain="
				+ LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_5).trim());
	}

	protected void logbackWithMessageFormat(org.slf4j.Logger logback) {
		logback.debug(MessageFormat.format("runLog4jTest(): High found in brown rice= {0}",
				LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_6).trim());
	}

	protected void logbackWithStringBuilder(org.slf4j.Logger logback) {
		logback.debug(new StringBuilder().append("runLog4jTest(): May make you sleepy=").
				append(LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_7).toString().trim());
	}

	protected void logbackWithStringFormat(org.slf4j.Logger logback) {
		logback.debug(String.format("runLog4jTest(): Can be found in Beans, Legumes and peanuts=%s",
				LoggingBenchmarkConstants.A_BODY_BUILDING_BLOCK_Amino_Acid_8).trim());
	}

}
